cmake_minimum_required(VERSION 2.8)

set(CMAKE_SYSTEM_NAME linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(COMPILER_PERFIX /opt/atk-dlrv1126-toolchain/bin/arm-linux-gnueabihf-)
set(CMAKE_C_COMPILER ${COMPILER_PERFIX}gcc)
set(CMAKE_CXX_COMPILER ${COMPILER_PERFIX}g++)

set(CMAKE_SYSROOT /opt/atk-dlrv1126-toolchain/arm-buildroot-linux-gnueabihf/sysroot)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

add_compile_options(-Wno-psabi)
set(CMAKE_CXX_STANDARD 17)
project(dev_sqlite CXX)


set(ARCH_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../common-rv1126)

set(SQL_INC_DIR ${ARCH_SOURCE_DIR}/include/sqlite3)
set(SQL_LIB_DIR ${ARCH_SOURCE_DIR}/lib/sqlite3)
set(MQTT_INC_DIR ${ARCH_SOURCE_DIR}/include/mosquitto)
set(MQTT_LIB_DIR ${ARCH_SOURCE_DIR}/lib/mosquitto)

include_directories(SQL_INC_DIR)
include_directories(${PROJECT_SOURCE_DIR}/sqlite3)
include_directories(${PROJECT_SOURCE_DIR}/jsoncpp)
include_directories(${PROJECT_SOURCE_DIR}/mqtt)
include_directories(${PROJECT_SOURCE_DIR}/spdlog)
include_directories(${MQTT_INC_DIR})

add_definitions(-DDEV_SQLITE_VERSION="V1.0.1")

include_directories(${PROJECT_SOURCE_DIR})
link_directories(${SQL_LIB_DIR})
link_directories(${MQTT_LIB_DIR})

aux_source_directory(. SRC)


add_executable(${PROJECT_NAME} ${SRC})

target_link_libraries(${PROJECT_NAME} sqlite3 pthread mosquitto)



























